package mysql

import "gorm.io/gorm"

//ToDo:抖音用户表

type Tiktok struct {
	gorm.Model
	Name     string `gorm:"type:varchar(20);not null;"`
	Phone    string `gorm:"type:char(11);not null;"`
	Password string `gorm:"type:varchar(256);not null;"`
}

func (t *Tiktok) login(phone string, password string) *gorm.DB {
	err := Db.Where("phone==? and password ==?", phone, password).Find(&t)
	return err
}
func (t *Tiktok) Add() error {
	return Db.Create(&t).Error
}
